<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>赋值运算符</h2>
    <p>赋值运算符用于给变量赋值</p>
    <ul>
        <li>=</li>
        <li>+=</li>
        <li>-=</li>
        <li>*=</li>
        <li>/=</li>
        <li>%=</li>
    </ul>
    <script>
        let a = 5;
        a += 3; // a = a + 3;
        console.log("a = ",a); // 8

        a = 5;
        a -= 3; // a = a - 3;
        console.log("a = ",a); // 2


        a = 5;
        a *= 3; // a = a * 3;
        console.log("a = ",a); // 15

        a = 6;
        a /= 3; // a = a / 3;
        console.log("a = ",a); // 2

        a = 7;
        a %= 3; // a = a % 3;
        console.log("a = ",a); // 1
    </script>
</body>
</html>